package com.zzzs.lock;

import sun.misc.Unsafe;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author zhu_shuai
 * @since 2021/7/19
 */
public class ReentrantLockTest {
    public void main(String[] args) {
        ReentrantLock reentrantLock = new ReentrantLock();
        Unsafe unsafe = Unsafe.getUnsafe();
        unsafe.compareAndSwapInt(this, 1, 0, 1);
        //noinspection AlibabaLockShouldWithTryFinally
        reentrantLock.lock();
        reentrantLock.unlock();
    }
}
